<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="opg8.css">
</head>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<body>
	<div style="border: 1px solid black;">
		Payment:<input type="radio" name="payment" value="credit" id="1" />Credit
		card <input type="radio" name="payment" value="wire" id="2" />Wire
		transfer
		<button onclick="buy()">Try it</button>
	</div>

	<div class="div_creditcard" style="border: 1px solid black;">
		Card number: <input type="text" name="number"
			onkeyup="validateNumber()" id=10 /> Expiration: <input maxlength="2"
			type="text" name="month" size="2" /> / <input maxlength="2"
			type="text" name="year" size="2" /> 3-digit security number: <input
			maxlength="3" type="text" name="security" size="3" />
	</div>

	<div class="div_wire" style="border: 1px solid black;">Transfer
		the amount to: reg. 9570, account 0009286322 (in Denmark)</div>

	<script>
	
		

		function validateNumber() {
			  var isWhole_re = /^\s*\d+\s*$/;
			if( String($('#10').val()).search(isWhole_re) != -1) {
			   alert("Successful match");				
			}
			else {
			   alert("No match");				
			}
 		}

		$(function() {
			
			$('#1').click(function() {
				$("div.div_creditcard").show();
				$("div.div_wire").hide();
			});
			$('#2').click(function() {
				$("div.div_wire").show();
				$("div.div_creditcard").hide();
			});
		});
	</script>
</body>
</html>